﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Samples.ServiceHosting.StorageClient;
using CloudAppMonitor.Data.EntityData;

namespace CloudAppMonitor.Data
{
    class CloudDataServiceContext : TableStorageDataServiceContext
    {
        public CloudDataServiceContext(StorageAccountInfo accountInfo)
            : base(accountInfo)
        {
        }

        public static readonly string PerformanceCountersTableName = "WADPerformanceCountersTable";
        public static readonly string WindowsEventLogsTableName = "WADWindowsEventLogsTable";
        public static readonly string WindowsAzureDiagnosticLogsTableName = "WADLogsTable";

        public IQueryable<PerformanceCountersTableEntity> PerformanceCountersTable
        {
            get
            {
                return this.CreateQuery<PerformanceCountersTableEntity>(PerformanceCountersTableName);
            }
        }

        public IQueryable<WindowsEventLogsTableEntity> WindowsEventLogs
        {
            get
            {
                return this.CreateQuery<WindowsEventLogsTableEntity>(WindowsEventLogsTableName);
            }
        }

        public IQueryable<WindowsAzureDiagnosticLogs> WindowsAzureDiagnosticLogs
        {
            get
            {
                return this.CreateQuery<WindowsAzureDiagnosticLogs>(WindowsAzureDiagnosticLogsTableName);
            }
        }
    }
}
